# 练习缺省参数
def func1(name, title="", gender="男生"):
    print("%s%s 是 %s" % (title, name, gender))


# 练习多值参数
def demo(a, b, *arge, **kwargs):
    print(a, b, arge, kwargs)


def func2(a, *args, **kwargs):
    print(a, args, kwargs)
    demo(*args, **kwargs)


# 练习类与对象
class Dog:
    def __init__(self, name, colour):
        self.name = name
        self.colour = colour

    def bark(self):
        print("%s在汪汪叫" % self.name)

    def swing(self):
        print("%s在摇尾巴" % self.name)


def func3():
    dog = Dog("大黄", "黄色")
    dog.bark()
    dog.swing()


if __name__ == '__main__':
    func1("小明")
    func1("小李", gender="学习委员")
    func1("小美", "班长", "女生")
    func2(1, 2, 3, 4, 5, "a", name="小明", age=12)
    func3()
